<?php
/**
 * @package PWE.controler
 * @author Gmax <gmaxfr78@gmail.com>
 */
class controler_install extends controler{    
    
    function __construct() {
        parent::__construct();
    }
    
    public function getOutput() {
        ob_start();
        
        include($this->_getHeaderPath());
        include($this->_getMainPath());
        include($this->_getFooterPath());
        
        $retour = $this->_process(ob_get_contents());
        ob_end_clean();
        
        bdd_sql::close();
        
        return $retour;
    }
    public function getContent(){
        include($this->_getTemplatePath());
    }
        
    /* private */
    private function _getTemplatePath(){
        if(navigation::getAdminTemplate()!==''){
            $path = 'install/'.navigation::getAdminTemplate().'.php';
            if(!file_exists($path)){
                $path = 'install/install.php';
            }
        }else{
            $path = 'install/install.php';
        }
        return $path;
    }
    private function _getHeaderPath(){
        $path = 'install/interface/header.php';
        return $path;
    }
    private function _getMainPath(){
        $path = 'install/interface/main.php';
        return $path;
    }
    private function _getFooterPath(){
        $path = 'install/interface/footer.php';
        return $path;
    }
}
?>
